package com.xbe.road.service.impl;

import com.xbe.common.core.text.Convert;
import com.xbe.road.domain.Road;
import com.xbe.road.mapper.RoadMapper;
import com.xbe.road.service.IRoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 道路设置Service业务层处理
 *
 * @author liuzhiting
 * @date 2020-06-18
 */
@Service
public class RoadServiceImpl implements IRoadService
{
    @Autowired
    private RoadMapper roadMapper;


    /**
     * 查询道路设置
     *
     * @param id 道路设置ID
     * @return 道路设置
     */
    @Override
    public Road selectRoadById(Long id)
    {
        return roadMapper.selectRoadById(id);
    }

    /**
     * 查询道路设置列表
     *
     * @param road 道路设置
     * @return 道路设置
     */
    @Override
    public List<Road> selectRoadList(Road road)
    {
        return roadMapper.selectRoadList(road);
    }

    /**
     * 新增道路设置
     *
     * @param road 道路设置
     * @return 结果
     */
    @Override
    public int insertRoad(Road road)
    {
        return roadMapper.insertRoad(road);
    }

    /**
     * 修改道路设置
     *
     * @param road 道路设置
     * @return 结果
     */
    @Override
    public int updateRoad(Road road)
    {
        return roadMapper.updateRoad(road);
    }

    /**
     * 删除道路设置对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRoadByIds(String ids)
    {
        return roadMapper.deleteRoadByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除道路设置信息
     *
     * @param id 道路设置ID
     * @return 结果
     */
    @Override
    public int deleteRoadById(Long id)
    {
        return roadMapper.deleteRoadById(id);
    }

    @Override
    public List<Road> selectRoadListByUserId(Road road)
    {
        return roadMapper.selectRoadListByUserId(road);
    }
}
